home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
1997.ZIP
/
ASC-SCAN.ARC
/
ASC-SCAN.C
next >
Wrap
Text File
|
1987-03-22
|
1KB
|
51 lines
/* --------------------------------------------- */
/* ASC-SCAN - Display interrupt 16 codes */
/* written in DeSmet C */
/* By Michael Burton Software 22 Mar 87 */
/* all rights reserved */
/* --------------------------------------------- */
#include "stdio.h"
#include "defstd.h"
extern _carryf,_zerof,_rax,_rbx,_rcx,_rdx,_rsi,_rdi,_res,_rds;
int sc,ac;
char display[9][39] = {
" Interrupt 16 keyboard codes ",
" ",
" ┌─────────────────╥─────────────────┐",
" │ ASCII ║ SCAN │",
" │ Dec Hex Chr ║ Dec Hex Chr │",
" ╞═════╤═════╤═════╬═════╤═════╤═════╡",
" │ │ │ ║ │ │ │",
" └─────┴─────┴─────╨─────┴─────┴─────┘",
" Control-C to Exit "};
main()
{
scr_cursoff();
scr_clr();
for (sc=0;sc<9;sc++)
{
scr_rowcol(9+sc,21);
printf("%s",&display[sc][0]);
}
do
{
_rax = 0;
_doint(0x16);
sc = (_rax >> 8) & 0xff;
ac = _rax & 0xff;
scr_rowcol(15,24);
printf("%3d │ %3x │ ║ %3d │ %3x",ac,ac,sc,sc);
scr_rowcol(15,37);
scr_co(ac);
scr_rowcol(15,55);
scr_co(sc);
} while (ac != 0x03);
scr_rowcol(0,0);
scr_curson();
scr_clr();
}